//
//  HZMSingleArticleCollectionViewCell.m
//  糖糖大魔王
//
//  Created by 韩震明 on 15/10/27.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "HZMSingleArticleCollectionViewCell.h"

@implementation HZMSingleArticleCollectionViewCell

- (void)dealloc
{
    [_priceLabel release];
    [_titleLabel release];
    [_topImageView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}


- (void)createCell
{
    // 贴个imageView作为item父视图更好看.找到合适背景贴上去
    
    self.topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 3 * self.contentView.frame.size.height / 4)];
    [self.contentView addSubview:self.topImageView];
    [_topImageView release];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 3 * self.contentView.frame.size.height / 4, self.contentView.frame.size.width, self.contentView.frame.size.height / 10)];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:13.0];
    
    self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 6 * self.contentView.frame.size.height / 7, self.contentView.frame.size.width, self.contentView.frame.size.height / 10)];
    [self.contentView addSubview:self.priceLabel];
    [_priceLabel release];
    self.priceLabel.font = [UIFont systemFontOfSize:13.0];
    self.priceLabel.textAlignment = NSTextAlignmentCenter;
    self.priceLabel.textColor = [UIColor redColor];
    
}

@end
